<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:replace="layout :: common_header(~{::title})">
    <title>添加业务员</title>
</head>
<body th:replace="layout :: common_body(~{::div.layui-body})">

<div class="layui-body" >



    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
        <legend>添加业务员</legend>
    </fieldset>

    <form class="layui-form" action="" method="post">

        <div class="layui-form-item">
            <label class="layui-form-label">姓名</label>
            <div class="layui-input-inline">
                <input type="text" name="trueName" lay-verify="required" autocomplete="off" placeholder="姓名" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">手机号</label>
            <div class="layui-input-inline">
                <input type="text" name="mobile" lay-verify="required" autocomplete="off" placeholder="手机号" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label">备注</label>
            <div class="layui-input-block">
                <textarea placeholder="分析总结" name="summary" class="layui-textarea"></textarea>
            </div>
        </div>

        <div class="layui-form-item">
            <div class="layui-input-block">
                <button type="submit" class="layui-btn" lay-submit="" lay-filter="demo1">立即提交</button>
                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
            </div>
        </div>

    </form>
    <!-- end sp-wrapper -->
    <script>
        layui.use(['laydate', 'form'], function () {
            var laydate = layui.laydate;
            var form = layui.form;
            var layer = layui.layer;

            //执行一个laydate实例
            laydate.render({
                elem: '#liveDate' //指定元素
            });


            //时间选择器
            laydate.render({
                elem: '#startTime'
                ,type: 'time'
            });
            laydate.render({
                elem: '#endTime'
                ,type: 'time'
            });

            //日期范围
            laydate.render({
                elem: '#reportPeriod'
                ,range: true
            });

            //自定义验证规则
            form.verify({
                dataInput: [
                    /(^$)|^(\d{4})[-\/](\d{1}|0\d{1}|1[0-2])([-\/](\d{1}|0\d{1}|[1-2][0-9]|3[0-1]))*$/
                    ,'日期格式不正确'
                ],
                numberInput:[/(^$)|^\d+$/,'只能填写数字'],
            });

            // //监听提交
            // form.on('submit(demo1)', function(data){
            //     // layer.alert(JSON.stringify(data.field), {
            //     //     title: '最终的提交信息'
            //     // })
            //     return true;
            // });
        });
    </script>

</div>
</body>
<html>
